package com.gigi.searchcenterbackendmaster.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 文章表
 * </p>
 *
 * @author Gigi
 * @since 2024-08-17
 */
@TableName("article")
@ApiModel(value="ArticleEntity对象", description="文章表")
public class ArticleEntity extends Model<ArticleEntity> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户id")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty(value = "标题")
    @TableField("title")
    private String title;

    @ApiModelProperty(value = "原始内容")
    @TableField("content_value")
    private String contentValue;

    @ApiModelProperty(value = "转义后内容")
    @TableField("content_html")
    private String contentHtml;

    @ApiModelProperty(value = "类型id")
    @TableField("type_id")
    private Long typeId;

    @ApiModelProperty(value = "标签id")
    @TableField("tag_id")
    private String tagId;

    @ApiModelProperty(value = "封面")
    @TableField("pic")
    private String pic;

    @ApiModelProperty(value = "摘要")
    @TableField("zhaiyao")
    private String zhaiyao;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "是否删除（0否 1是）")
    @TableField("if_delete")
    @TableLogic
    private Integer ifDelete;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    public String getContentValue() {
        return contentValue;
    }

    public void setContentValue(String contentValue) {
        this.contentValue = contentValue;
    }
    public String getContentHtml() {
        return contentHtml;
    }

    public void setContentHtml(String contentHtml) {
        this.contentHtml = contentHtml;
    }
    public Long getTypeId() {
        return typeId;
    }

    public void setTypeId(Long typeId) {
        this.typeId = typeId;
    }
    public String getTagId() {
        return tagId;
    }

    public void setTagId(String tagId) {
        this.tagId = tagId;
    }
    public String getPic() {
        return pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }
    public String getZhaiyao() {
        return zhaiyao;
    }

    public void setZhaiyao(String zhaiyao) {
        this.zhaiyao = zhaiyao;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    public Integer getIfDelete() {
        return ifDelete;
    }

    public void setIfDelete(Integer ifDelete) {
        this.ifDelete = ifDelete;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "ArticleEntity{" +
            "id=" + id +
            ", userId=" + userId +
            ", title=" + title +
            ", contentValue=" + contentValue +
            ", contentHtml=" + contentHtml +
            ", typeId=" + typeId +
            ", tagId=" + tagId +
            ", pic=" + pic +
            ", zhaiyao=" + zhaiyao +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
            ", ifDelete=" + ifDelete +
        "}";
    }
}
